<?php

namespace Admin\Model;

class ArgumentsModel extends \Think\Model{

	public function getAll(){

		$arg = $this->field('arg.id argid,arg.text argtext,arg.addtime argadd,u.name uname,arg.status args,g.name gname')->table('arguments arg,user u,goods g')->where('arg.uid=u.id and arg.status=0 and arg.goods_id = g.id')->select();
		
		return $arg;
	}
	/*----------------评论审核通过-----------------*/

			public function auditk($id){
			
			$res=$this->data('status=1')->where('id='.$id)->save();
			
			return $res;
			}

	/*----------------评论审核不通过-----------------*/

			public function auditn($id){
			
			$res=$this->data('status=2')->where('id='.$id)->save();
			
			return $res;
			}

	/*----------------后台删除评论-----------------*/

			public function delet($id){
			
				$res=$this->where('id='.$id)->delete();
			
			return $res;
			}
}